﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace Dropit.BlogPageProvider.Configuration
{
	public class ProviderCollection : ConfigurationElementCollection
	{
		public Provider this[int index]
		{
			get { return (Provider)base.BaseGet(index); }
			set
			{
				if (base.BaseGet(index) != null)
				{
					base.BaseRemoveAt(index);
				}
				this.BaseAdd(index, value);
			}
		}

		public new Provider this[string key]
		{
			get { return (Provider)base.BaseGet(key); }
		}

		protected override ConfigurationElement CreateNewElement()
		{
			return new Provider();
		}

		protected override object GetElementKey(ConfigurationElement element)
		{
			return ((Provider)element).Name;
		}
	}
}
